<template>
  <TbTitle title="（二）、内部管理情况" />
  <TbTitle level="2" title="（1）本年度登记、备案事项变更情况" />
  <table border="0" class="m-table">
    <tr>
      <td style="width: 25%;">变更事项</td>
      <td style="width: 25%;">是否变</td>
      <td style="width: 25%;">办理情况</td>
      <td style="width: 25%;">批准时间</td>
    </tr>
    <tr v-for="item in yearlyRegister">
      <td style="width: 25%;">{{ item.filingMatter }}</td>
      <td style="width: 25%;">{{ yesNoBool(item.filingType) }}</td>
      <td style="width: 25%;">{{ dictToVal(dict1, item.handleSituation) }}</td>
      <td style="width: 25%;">{{ item.capproveTime }}</td>
    </tr>
  </table>
  <TbTitle level="2" title="（2）本年度会议及换届情况" />
  <table border="0" class="m-table">
    <tr>
      <td>章程规定</td>
      <td>会议情况</td>
      <td colspan="2">换届情况</td>
    </tr>
    <tr>
      <td>
        理（董）事会（
        {{ yearlyMeeting.directorMeetingInterval }}
        ）年一届
      </td>
      <td>
        本年度召开理（董）事会（
        <span>{{ yearlyMeeting.yearlyDirectorMeetingCount }}</span>
        ）次
      </td>
      <td>
        上一次换届理（董）事会召开时间
      </td>
      <!-- <td>2024-07-15</td> -->
      <td>{{ yearlyMeeting.recentlyChangeTenureTime }}</td>
    </tr>
    <tr>
      <td>
        理（董）事会（
        <span>{{ yearlyMeeting.executiveDirectorMeetingInterval }}</span>
        ）年（
        <span>{{ yearlyMeeting.executiveDirectorMeetingOrder }}</span>
        ）次
      </td>
      <td colspan="2">
        监事（会）是否列席理（董）事会
      </td>
      <td colspan="1">
        {{yearlyMeeting.supervisorAttendance == 1?'是':'否'}}
      </td>
    </tr>
    <tr>
      <td>
        未按期召开原因或者未按期换届说明
      </td>
      <td colspan="3">
        {{ yearlyMeeting.failureDirectorMeeting }}
      </td>
    </tr>
  </table>

  <TbTitle level="2" title="（3）内部制度建设情况" />
  <table border="0" class="m-table">
    <tr>
      <td rowspan="2">证书印章管理</td>
      <td>证书保管、使用管理制度</td>
      <td style="width: 120px;">{{ yesNoBool(regulatory.legalCertificateRegime) }}</td>
      <td>保管在</td>
      <td>{{ regulatory.legalCertificateRegimeDeposit }}</td>
    </tr>
    <tr>
      <td>印章保管、使用管理制度</td>
      <td>{{ yesNoBool(regulatory.sealRegime) }}</td>
      <td>保管在</td>
      <td colspan="2">{{ regulatory.sealRegimeDeposit }}</td>
    </tr>
    <tr>
      <td>档案管理</td>
      <td>档案管理制度</td>
      <td>{{ yesNoBool(regulatory.archivesRegime) }}</td>
      <td>保管在</td>
      <td>{{ regulatory.archivesRegimeDeposit }}</td>
    </tr>
    <tr>
      <td rowspan="9">财务管理</td>
      <td colspan="2">人民币开户银行</td>
      <td colspan="3">{{ regulatory.openingBank }}</td>
    </tr>
    <tr>
      <td colspan="2">人民币银行账号</td>
      <td colspan="3">{{ regulatory.accountNum }}</td>
    </tr>
    <tr>
      <td colspan="2">外币开户银行</td>
      <td colspan="3">{{ regulatory.openingBankFc }}</td>
    </tr>
    <tr>
      <td colspan="2">外币银行账号</td>
      <td colspan="3">{{ regulatory.accountNumFc }}</td>
    </tr>
    <tr>
      <td>财政登记</td>
      <td>{{ yesNoBool(regulatory.legalCertificateRegime) }}</td>
      <td>税务登记</td>
      <td colspan="5">
        {{ regulatory.taxRegistration == 1?'已登记':'未登记'}}
      </td>
    </tr>
    <tr>
      <td>财务管理制度</td>
      <td>{{ yesNoBool(regulatory.financeRegime) }}</td>
      <td>固定资产管理制度</td>
      <td colspan="2">{{ yesNoBool(regulatory.fixedAssetsRegime) }}</td>
    </tr>
    <tr>
      <td colspan="2">执行会计制度</td>
      <td colspan="3">{{ dictToVal(dict2, regulatory.implementAccountingRegime) }}</td>
    </tr>
    <tr>
      <td>专职财会人员数</td>
      <td>{{ regulatory.fullTimeAccountingCount }}</td>
      <td>具有会计执业资格人数</td>
      <td colspan="2">{{ regulatory.fullTimeAccountingQualificationCount }}</td>
    </tr>
    <tr>
      <td colspan="2">使用票据种类</td>
      <td colspan="3">
        {{ dictToVal(dict3, regulatory.billType) }}
      </td>
    </tr>
  </table>
</template>

<script setup lang="ts">
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
import { ref, reactive, inject, getCurrentInstance } from 'vue'
import { getDictHandle, getDictBillType, getDictAccounting } from '@/api/dict/index'
// let detailInfo = reactive({ yearlyMeeting: {}, regulatory: {}, yearlyRegister: [] })

const { proxy } = getCurrentInstance();
const yesNoBool = proxy.$yesNoBool

let yearlyMeeting = ref({})
let regulatory = ref({})
let yearlyRegister = ref([])
const { getDetailInfo } = inject('getDetailInfo')
const dict1 = ref([])
const dict2 = ref([])
const dict3 = ref([])


getDetailInfo().then(res => {
  // Object.assign(detailInfo, res)
  yearlyMeeting.value = res.data.yearlyMeeting;
  regulatory.value = res.data.regulatory;
  yearlyRegister.value = res.data.yearlyRegister;
})

let getDictInfo = () => {
  //办理情况
  getDictHandle().then(res => {
    dict1.value = res.data
  })
  //执行会计制度
  getDictAccounting().then(res => {
    dict2.value = res.data
  })
  //票据种类
  getDictBillType().then(res => {
    dict3.value = res.data
  })

}

const dictToVal = (dictList, val) => {
  for (let i = 0; i < dictList.length; i++) {
    if (val == dictList[i].id) {
      return dictList[i].name
    }
  }
}
getDictInfo()
</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;
  font-family: '微软雅黑';
}

.msg-tip {
  padding: 20px 0;
  color: #000;
  font-family: '微软雅黑';
}
</style>
